<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace AlibabaCloud\Client\Resolver;

trait CallTrait
{
    public function __call($name, $arguments)
    {
        if(strncmp($name, "get", 3) === 0) {
            $parameter = mb_strcut($name, 3);
            return $this->__get($parameter);
        }
        if(strncmp($name, "with", 4) === 0) {
            $parameter = mb_strcut($name, 4);
            $value = $this->getCallArguments($name, $arguments);
            $this->data[$parameter] = $value;
            $this->parameterPosition()[$parameter] = $value;
            return $this;
        }
        if(strncmp($name, "set", 3) === 0) {
            $parameter = mb_strcut($name, 3);
            $with_method = "with" . $parameter;
            return $this->{$with_method}($this->getCallArguments($name, $arguments));
        }
        throw new \RuntimeException("Call to undefined method " . self::class . "::" . $name . "()");
    }
    private function getCallArguments($name, array $arguments, $index = 0)
    {
        if(!isset($arguments[$index])) {
            throw new \ArgumentCountError("Missing arguments to method " . $name);
        }
        return $arguments[$index];
    }
}

?>